﻿using System.Collections.Generic;

public sealed class GlobalInfo
{
    private static volatile GlobalInfo instance;
    private static readonly object obj = new object();

    public const string ServerListUrl = "http://10.18.40.236/server/server.json";//服务器列表地址

    public const string LastAccId = "LastAccount";
    public const string LastServetIp = "lastServerIp";
    public const string LastServerName = "lastServerName";

    public LoginData UserLoginData = null;
    public TokenInfo UserTokenInfo = null;

    public static GlobalInfo Instance
    {
        get
        {
            if (null == instance)
            {
                lock (obj)
                {
                    if (null == instance)
                    {
                        instance = new GlobalInfo();                       
                    }
                }

            }
            return instance;
        }
    }

    public class LoginData
    {
        public string account;
        public string asInfo;
        public bool banLogin;
        public string country;
        public long createTime;
        public string lang;
        public string opId;
        public string platform;
        public string serverId;
        public string token = "";
        public string tokenSrc = "";
        public string uniqueId;
    }

    public class TokenInfo
    {
        public string account;
        public string worldId;
        public string playerId;
        public long longplayerId;
        public int timeStamp;
        public string clientIp;
        public string digest;
        public string address;
    }

    public class ServerInfo
    {
        public List<ServerInfoItem> serverList = new List<ServerInfoItem>();
    }

    public class ServerInfoItem
    {
        public int port;
        public string serverIp;
        public string serverName;
    }
}
